<template>
    <div class="layout-main">
        <div>
            <el-form ref="sysconfig" label-position="right" label-width="120px"  :model="sysconfig" :rules="rules">
                <el-form-item label="站点名称" prop="webName">
                    <el-row>
                        <el-col :span="8">
                            <el-input size="small" style="width: 360px" v-model="sysconfig.webName" placeholder="站点名称" />
                        </el-col>
                    </el-row>
                </el-form-item>
                <el-form-item label="站点URL" prop="webUrl">
                    <el-row>
                        <el-col :span="8">
                            <el-input size="small" style="width: 360px" v-model="sysconfig.webUrl" placeholder="站点URL" />
                        </el-col>
                    </el-row>
                </el-form-item>
                <el-form-item label="手机站点URL" prop="webAppUrl">
                    <el-row>
                        <el-col :span="8">
                            <el-input size="small" style="width: 360px" v-model="sysconfig.webAppUrl" placeholder="站点URL" />
                        </el-col>
                    </el-row>
                </el-form-item>
                <el-form-item label="站点标题" prop="webTitle">
                    <el-row>
                        <el-col :span="8">
                            <el-input size="small" style="width: 360px" v-model="sysconfig.webTitle" placeholder="站点标题" />
                        </el-col>
                    </el-row>
                </el-form-item>
                <el-form-item label="站点关键字" prop="webKeywords">
                    <el-row>
                        <el-col :span="8">
                            <el-input size="small" style="width: 360px" v-model="sysconfig.webKeywords" placeholder="站点关键字" />
                        </el-col>
                    </el-row>
                </el-form-item>
                <el-form-item label="站点描述" prop="webDescript">
                    <el-row>
                        <el-col :span="8">
                            <el-input size="small" style="width: 360px" type="textarea" v-model="sysconfig.webDescript" placeholder="站点描述" />
                        </el-col>
                    </el-row>
                </el-form-item>


                 <el-form-item label="金谷接口" prop="jinguUrl">
                    <el-row>
                        <el-col :span="8">
                            <el-input size="small" style="width: 360px" v-model="sysconfig.jinguUrl" placeholder="金谷接口" />
                        </el-col>
                    </el-row>
                </el-form-item>

            </el-form>
            <div>
                <el-button size="small" @click="cancel">取消</el-button>
                <el-button size="small" type="primary" :loading="modalLoading" @click="ok">确定</el-button>
            </div>
        </div>
    </div>
</template>
<script>
// import api from '@/api/api';
export default {
    name: 'Merchant',
    data() {
        return {
            loading: false,
            modalLoading: false,

            others: {

            },
            sysconfig: {
                storageType: 0
            },
            rules: {

            },

        };
    },
    mounted: function() {

        this.getDetail();

    },
    methods: {
        cbtime: function(value) {
            this.others;
        },
        getDetail: function() {

            var me = this;


            me.showLoading();
            me.$http.post("sys/sysconfig/get.action").then(response => {
                var body = response;
                if (body.status == 0) {
                    me.sysconfig = body.obj;

                } else {
                    me.errorMessage(body.info);
                }
                me.hideLoading();
            }, response => {
                me.hideLoading();
            });
        },

        ok: function() {
            var ok = false;
            this.$refs['sysconfig'].validate((valid) => {
                ok = valid;
                if (!valid) {
                    this.errorMessage('请认真填写数据');
                }
            })
            if (!ok) return;
            var me = this;

            me.modalLoading = true;
            me.$http.post("/sys/sysconfig/doSave.action", me.sysconfig).then(response => {
                var body = response;
                if (body.status == 0) {
                    me.successMessage("保存成功！");

                    me.modalEdit = false;

                } else {
                    me.errorMessage(body.info);
                }
                me.modalLoading = false;
            }, response => {
                me.modalLoading = false;
            });
        },
        cancel: function() {
            this.getDetail();
        }
    }
}
</script>
<style scoped>
</style>